#!/usr/bin/env python
# encoding: utf-8
# @Time : 2020/4/23 17:48 
# @Author : 能量咖啡豆 
# @File : 88.py 
# @desc : 88. 合并两个有序数组

"""
利用排序算法,双指针
"""
def solution(nums1,m,nums2,n):
    print("hello")


"""
加标记构建
"""
def solution(nums1,m,nums2):
    nums1 = nums1[0:m]

    temp1 = nums1.pop(0)
    temp2 = nums2.pop(0)
    while len(nums1) != 0 and len(nums2) != 0:
        if temp1 <= temp2:
            nums1.append(temp1)
            temp1 = nums1.pop(0)
        else:
            nums1.append(temp2)
            temp2 = nums2.pop(0)
    while len(nums1) != 0:
        nums1.append(temp1)
        temp1 = nums1.pop(0)
    while len(nums2) != 0:
        nums1.append(temp2)
        temp2 = nums2.pop(0)

    return nums1


if __name__ == "__main__":
    print("hello")
    num1 = [1,2,3,0,0,0]
    num2 = [2,5,6]
    nums = [1,2,3]
    nums.insert(1,0)
    print(nums)
    #print(solution(num1,3,num2))

